home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iactext.c < prev   
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.4 KB  |  75 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7. Boolean IACpushtextparam (Handle val, OSType keyword) {
  8.  
  9.     return (IACpushbinaryitem (IACglobals.event, val, typeChar, keyword));
  10.     } /*IACpushtextparam*/
  11.  
  12.  
  13. Boolean IACreturntext (Handle x) {
  14.     
  15.     return (IACpushbinaryitem (IACglobals.reply, x, typeChar, keyDirectObject));
  16.     } /*IACreturntext*/
  17.     
  18.     
  19. Boolean IACgettextparam (OSType keyword, Handle *htext) {
  20.     
  21.     if (!IACgettextitem (IACglobals.event, keyword, htext)) {
  22.         
  23.         IACparamerror (IACglobals.errorcode, "\ptext", keyword);
  24.         
  25.         return (false);
  26.         }
  27.     
  28.     IACglobals.nextparamoptional = false; /*must be reset for each param*/
  29.     
  30.     return (true);
  31.     } /*IACgettextparam*/
  32.     
  33.  
  34. Boolean IACgettextitem (AEDescList *list, long n, Handle *val) {
  35.     
  36.     register OSErr ec;
  37.     AEDesc desc;
  38.     DescType key;
  39.     Size actualSize;
  40.     
  41.     if ((*list).descriptorType != typeAEList) {
  42.     
  43.         ec = AEGetKeyDesc (list, n, typeChar, &desc);
  44.         
  45.         if (ec != errAEDescNotFound)
  46.             goto done;
  47.         }
  48.  
  49.     ec = AEGetNthDesc (list, n, typeChar, &key, &desc);
  50.     
  51.     done:
  52.     
  53.     IACglobals.errorcode = ec;
  54.     
  55.     if (ec == noErr) {
  56.     
  57.         *val = desc.dataHandle;    
  58.         
  59.         return (true);
  60.         }
  61.     else {
  62.         *val = NULL;
  63.         
  64.         return (false);
  65.         }
  66.     } /*IACgettextitem*/
  67.     
  68.  
  69. Boolean IACpushtextitem (AEDescList *list, Handle val, long n) {
  70.     
  71.     return (IACpushbinaryitem (list, val, typeChar, n));
  72.     } /*IACpushtextitem*/
  73.  
  74.  
  75.